<template>
  <div class="enterprise">
    <!-- <Mapview ref="baseMap" @mapLoad="mapLoad"></Mapview> -->
    <div class="bg">
      <HeadBox title="农业农村"></HeadBox>
      <div class="main">
        <el-col :span="24">
          <!-- <object
            data="http://tip-dp.litec.top:81/transferPage?otherToken=7vgdea3iyonyynrj9p0u6xcm40dtbvbt"
            width="400"
            height="300"
            type="text/html"
          >
            Alternative Content
          </object> -->
          <iframe v-if="reloadIframe" id="iframe1" name="iframe1" :src="iframeUrl" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
        </el-col>
      </div>
    </div>
  </div>
</template>
<script>
// import Mapview from '@/components/map-container/index.vue'
export default {
  components: {
    // Mapview,
  },
  data() {
    return {
      iframeUrl: '',
      reloadIframe: false,
      urlType: Math.random() * 10,
    }
  },
  created() {},
  mounted() {
    // http://tip-dp.litec.top:81/transferPage?otherToken=7vgdea3iyonyynrj9p0u6xcm40dtbvbt
    this.analysisRouter()
  },
  methods: {
    mapLoad(amap) {
      this.map = amap
    },
    analysisRouter() {
      // 先让iframe销毁
      this.reloadIframe = false
      this.$nextTick(() => {
        // 赋值地址，再加载
        this.iframeUrl = 'http://tip-dp.litec.top:81/dashboard'
        this.reloadIframe = true

        console.log('AAAAAAAAAAA', window.frames[this.$refs.iframe1])
      })
    },
  },
}
</script>
<style lang="less" scoped>
#maptools {
  .icon-layer {
    background: url('../../assets/image/icon/icon1.png') top no-repeat;
  }
  .icon-point {
    background: url('../../assets/image/icon/icon2.png') top no-repeat;
  }
  .icon-plug {
    background: url('../../assets/image/icon/icon3.png') top no-repeat;
  }
  .icon-reduce {
    background: url('../../assets/image/icon/icon4.png') top no-repeat;
  }
}
.bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 997;
  background: url('../../assets/image/bg.png') top no-repeat;
  background-size: 100% 100%;
}
#iframe1 {
  pointer-events: all;
}
.main {
  display: flex;
  padding: 90px 50px 0;
  justify-content: space-between;
  height: 80vh;
}
</style>
